var fs = require('fs');

var vmtools = require('./tools/tools.node.js');
var htmlelements = require('./browser/HTMLElements/htmlelements.node.js')
function GetCode(){
    var code = "";
    code += vmtools.GetCode()+"\r\n";

    code += "catvm.memory.config.proxy = true;\r\n";
    code += fs.readFileSync(`${__dirname}/browser/EventTarget.js`) +"\r\n";
    code += fs.readFileSync(`${__dirname}/browser/WindowProperties.js`) +"\r\n";


    code += fs.readFileSync(`${__dirname}/browser/Window.js`) +"\r\n";
    code += fs.readFileSync(`${__dirname}/browser/Image.js`) +"\r\n";
    code += fs.readFileSync(`${__dirname}/browser/Location.js`) +"\r\n";
    code += fs.readFileSync(`${__dirname}/browser/Navigator.js`) +"\r\n";
    code += fs.readFileSync(`${__dirname}/browser/History.js`) +"\r\n";
    code += fs.readFileSync(`${__dirname}/browser/Screen.js`) +"\r\n";

    code += htmlelements.GetCode() + "\r\n";
    code += fs.readFileSync(`${__dirname}/browser/Document.js`) +"\r\n";
    code += fs.readFileSync(`${__dirname}/browser/XMLHttpRequest.js`) +"\r\n";

    code +="window.self=window;debugger;\r\n";
    return code;
}

module.exports = {
    GetCode
}